package com.jiuyi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiuyi.entity.Setmeal;
import com.jiuyi.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * DATA: 2022/10/23
 * Author: 晨夕
 */
@Mapper
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {
    //数量加一
    void updateNumber(@Param("id") Long id);
    //根据setmealId查询订单是否存在
    ShoppingCart selectSetmealById(@Param("setmealId")Long setmealId);
    //根据口味查询订单是否存在
    ShoppingCart selectDishByDishFlavor(@Param("dishFlavor")String dishFlavor);
    //蜂聚用户id查所有订单
    List<ShoppingCart> selectByUserId(@Param("userId")Long userId);
    //数量减一
    void subNumber(@Param("id")Long id);
    //获取订单数量
    int selectNumber(@Param("id")Long id);
}
